import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86132
 * Date: 2022-04-12
 * Time: 20:45
 */
public class Test {
    // 查找组成一个偶数最接近的两个素数
    import java.util.*;
    public class Main {
        public static void main(String[] args){
            Scanner sc=new Scanner(System.in);
            while(sc.hasNext()){
                int n=sc.nextInt();
                int half=n/2;
                for(int i=half;i>0;i--){
                    if(isPrime(i)&&isPrime(n-i)){
                        System.out.println(i);
                        System.out.println(n-i);
                        break;
                    }
                }
            }
        }//素数的因数是1和它本身
        public static boolean isPrime(int num){
            for(int i=2;i<num;i++){
                if(num%i==0){
                    return false;
                }
            }
            return true;
        }
    }
}
